package com.leetcode;

/**
 * 326. 3 的幂
 *
 * @author fy
 * @date 2022-04-23 22:30
 */
public class Solution326 {

    public boolean isPowerOfThree(int n) {
        while (n != 0 && n % 3 == 0) {
            n = n / 3;
        }
        return n == 1;
    }

}
